import request from '@/utils/request'

// 清除生产数据
export function cleanProductionData(){
  return request({
    url: '/line/production/batch/cleanProductionData',
    method: 'post',
  })
}

// 查询型材批次明细列表
export function listBatch(query) {
  return request({
    url: '/line/production/batch/list',
    method: 'get',
    params: query
  })
}

// 查询型材批次明细详细
export function getBatch(id) {
  return request({
    url: '/line/production/batch/' + id,
    method: 'get'
  })
}

// 新增型材批次明细
export function addBatch(data) {
  return request({
    url: '/line/production/batch',
    method: 'post',
    data: data
  })
}

// 修改型材批次明细
export function updateBatch(data) {
  return request({
    url: '/line/production/batch',
    method: 'put',
    data: data
  })
}

// 删除型材批次明细
export function delBatch(id) {
  return request({
    url: '/line/production/batch/' + id,
    method: 'delete'
  })
}

// 导出型材批次明细
export function exportBatch(query) {
  return request({
    url: '/line/production/batch/export',
    method: 'get',
    params: query
  })
}

export function startProduction(data) {
  return request({
    url: '/line/production/batch/startProduction',
    method: 'post',
    data: data
  })
}

export function startProductionDemo(data) {
  return request({
    url: '/line/demo/startProductionDemo',
    method: 'post',
    data: data
  })
}

// 下载用户导入模板
export function importTemplate() {
  return request({
    url: '/line/production/batch/importTemplate',
    method: 'get'
  })
}


// 获取型材批次明细
export function getBatchDetails(query) {
  return request({
    url: '/line/production/batch/getDetails',
    method: 'get',
    params: query
  })
}
